package cwb1;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * This class represents a nightlife activity.
 * 
 * @author Aurora
 *
 */
public class Nightlife extends Activity
{
	// A personal rate for the amount of alcohol consumed during the nightlife activity.
    private long alcoholRate;
    
    /**
     * This method makes a nightlife (activity) object.
     * 
     * @param startDate The start date of the nightlife activity.
     * @param userId The userId who has done the nightlife activity.
     */
    public Nightlife(Date startDate, String userId)
    {
        super(startDate, userId, ActivityFactory.NIGHTLIFE);
        alcoholRate = 0;
    }
    
    /**
     * Creates a new Nightlife object using the values of the Map for setting the fields.
     * Be warned, the values are never checked. 
     * 
     * @param properties A Map containing: activity properties, "alcoholRate" with long.
     */
    public Nightlife(Map<String,Object> properties)
    {
    	super(properties);
    	setActivityType(ActivityFactory.NIGHTLIFE);
    	alcoholRate = (Long) properties.get("alcoholRate");
    }
    
    /**
     * This method returns the properties (personal rates) of the nightlife activity.
     * 
     * return HashMap with the properties (personal rates) as content and the name of the properties as corresponding key.
     */
    public HashMap<String,Object> getProperties()
    {
    	HashMap<String, Object> properties = super.getProperties();
    	properties.put("alcoholRate", alcoholRate);
    	
    	return properties;
    }
    
    /**
     * This method returns the alcohol rate corresponding the nightlife activity.
     * 
     * @return The alcohol rate corresponding the nightlife activity.
     */
    public long getAlcoholRate()
    {
        return alcoholRate;
    }
    
    /**
     * This method changes the alcohol rate of the nightlife activity to the given value.
     * 
     * @param value The new value for the alcohol rate of the nightlife activity.
     */
    public void setAlcoholRate(long value)
    {
        alcoholRate = value;
    }
    
    
}
